package com.csr.csrcheck.util;

import java.io.Serializable;

public class JsonResult<T> implements Serializable {
    private static final long serialVersionUID = -3675277270614887834L;

    private Integer code;

    private String msg;

    private T data;

    public JsonResult() {}

    public JsonResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public JsonResult(Throwable e) {
        this.msg = e.getMessage();
    }

    public JsonResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getcode() {
        return this.code;
    }

    public void setcode(Integer code) {
        this.code = code;
    }

    public String getmsg() {
        return this.msg;
    }

    public void setmsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
